using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.XtraEditors;

namespace Comteck.Winforms {
  /// <summary>
  /// 
  /// </summary>
  public static class TreeListLookUpEditExtensions {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="treeList"></param>
    public static void PopupWithFirstNode(this TreeListLookUpEdit treeList) {
      treeList.ShowPopup();

      if (treeList.Properties.TreeList.Nodes.Count > 0) {
        treeList.Properties.TreeList.FocusedNode = treeList.Properties.TreeList.Nodes[0];
        treeList.Properties.TreeList.SelectNode(treeList.Properties.TreeList.Nodes[0]);
      }
    }
  }
}
